<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>搜事网-处理规则[网页]</title>
<!-- 引用文件:start-->
<jsp:include page="includes.jsp" />
<%@ page language="java" contentType="text/html;charset=UTF-8"
	import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!-- 引用文件:end-->
<!-- JS头文件:start -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
<script src="http://malsup.github.com/jquery.form.js"></script>
<script>
	// wait for the DOM to be loaded     
	$(document).ready(function() {
		$('#myForm').ajaxForm(function() {
			//alert("Thank you for your comment!");
		});
	});
</script>
<!-- JS头文件:end -->
</head>
<body>
	<div class="wrap">
		<!-- header:start -->
		<jsp:include page="banner.jsp" />
		<!-- header:end -->
		<div id="body">
			<div id="left" class="wrap">
				<h1 class="page">
					<span>抽取规则</span>
				</h1>
				<div class="main lside176">
					<jsp:include page="left_banner.jsp" />
					<div class="middle w804">
						<div id="left" class="w804">
							<div class="main">
								<div class="topbox">
									<div class="tabs">
										<a href="listSource.do"><span>媒体源管理</span></a> <a
											href="listSourceCategory.do"><span>媒体分组管理</span></a>
									</div>
								</div>
								<div class="tabContent">
									<div class="listForm">


										<button class="btn modify" onclick="newTemplate()">新建</button>
											<button name="delselect" class="btn delete" type="submit"
												onclick="document.delForm.submit()">删除</button>
										<form action="deleteTemplate.do" method="post" name="delForm">
											<s:textfield name="sourceId" style="display:none" />
											<s:if test="templates.size>0">
												<table class="t" width="100%" cellspacing="1">
													<tr class="odd">
														<td></td>
														<!-- 														<td>抽取规则</td> -->
														<td>媒体源</td>
														<td>内容规则</td>
														<td>是否更新</td>
														<td>编辑</td>
													</tr>
													<s:iterator value="templates">
														<tr>
															<td><input type="checkbox" name="delIds"
																value="${id}" /></td>
															<!-- 															<td><s:property value="urlRegex" /></td> -->
															<td><s:property value="source.name" /></td>
															<td><s:property value="contentUrlRegex" /></td>
															<td><s:property value="needUpdate" /></td>
															<td><a href="listWeb.do?templateId=${id}">[设置]</a></td>
														</tr>
													</s:iterator>
												</table>
											</s:if>
										</form>
										<!-- 分页:start -->
										<div class="pagination">
											<s:if test="curPage!=1">
												<a
													href="listWebs.do?sourceId=${sourceId}&curPage=1&pageSize=${pageSize}">首页</a>
												<a
													href="listWebs.do?sourceId=${sourceId}&curPage=${curPage-1}&pageSize=${pageSize}">上一页</a>
											</s:if>
											<s:if test="curPage!=totalPage">
												<a
													href="listWebs.do?sourceId=${sourceId}&curPage=${curPage+1}&pageSize=${pageSize}">下一页</a>
												<a
													href="listWebs.do?sourceId=${sourceId}&curPage=${totalPage}&pageSize=${pageSize}">末页</a>
											</s:if>
											当前
											<s:property value="curPage" />
											/
											<s:property value="totalPage" />
											页
										</div>
										<!-- 分页:end -->
										<script>
											function saveTemplate() {
												document
														.getElementById('dialog').style.display = 'none';
												document.getElementById(
														'myForm').submit();
											}
											function newTemplate() {
												document
														.getElementById('dialog').style.display = 'block';
											}
										</script>


									</div>
								</div>
							</div>
						</div>
					</div>
					<jsp:include page="footer.jsp" />

					<div class="clear"></div>
				</div>
			</div>
		</div>
	</div>

	<div class="dialogLayer" id="dialog" style='display: none'>
		<div class="mask">
			<iframe frameborder="0" width="100%" height="100%"
				src="transparent.html" allowtransparency="true"></iframe>
		</div>
		<div class="pos1" style="width: 600px;">
			<div class="pos2">
				<div class="dialog">
					<a class="close" href="javascript:void(0)"
						onclick="var P='parentNode'; this[P][P][P][P].style.display='none'"></a>
					<form id="myForm" action="saveTemplate.do" method="post">
						<h1>新建模版</h1>

						<div>
							<table class="infoTable" width="100%" cellspacing="1">

								<tr>
									<td class="h">内容URL</td>
									<td><label><span class="inputtxt"> <s:textfield
													name="contentUrlRegex" theme="simple" size="30"></s:textfield>
										</span></label></td>
								</tr>


							</table>
							<hr />
							<p>
								<input class="btn" type="button" onclick="saveTemplate()"
									value="确认" /> &emsp;
								<button class="btn" type="button"
									onclick="document.getElementById('dialog').style.display='none'">取消</button>
							</p>
						</div>
						<s:textfield style="display:none" name="sourceId" />
					</form>





				</div>
			</div>
		</div>
	</div>


</body>
</html>
